<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue测试.html</title>
    <!--导入js package-->
    <script type="text/javascript" src="../01-vue_js/vue.js"></script>
</head>
<body>

<div id="root">
    <div>{{name}}</div>
    <div v-text="name"></div>

    <br><br>
    <div v-html="str"></div>

    <br><br>
    <div v-cloak>{{name}}</div>
    <br><br>

    <h2 v-once>初始化的n值：{{n}}</h2>
    <h2>当前的n值：{{n}}</h2>
    <button @click="n++">点我+1</button>
</div>

<script type="text/javascript">
    // 关闭开发环境的警告提示
    Vue.config.productionTip = false
    // 创建vue的对象
    new Vue({
        el: '#root',
        data: {
            n:1,
            name:"庄小焱",
            str:"<h2>hi你好</h2>"
        }
    })
</script>
</body>
</html>